Learn Python 3.0 VISUALLY: with 99 Interactive Exercises and Quizzes (Learn Visually Book 1) by Ivelin Demirov

Learn Python 3.0 VISUALLY: with 99 Interactive Exercises and Quizzes (Learn Visually Book 1) by Ivelin Demirov

Author:Ivelin Demirov
Language: eng
Format: azw3, epub
Published: 2015-05-28T07:00:00+00:00


While

Python provides break and continue statements to have even better control on your loop.

while <test1>:

<statement1>

if <test2>: break #loop exit, skip else

if <test3>: continue #go to the top <test1>

else:

<statement2> #run if break didn’t happen

Loops

You can use a “for” loop to iterate though a collection.

Let’s say you have the following list:

a = [“one”, “two”, “three”]

To print each string individually, you could use this loop:

for item in a:

print(item)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.